package com.wechatapp.mengyao.poetry.service;

import com.wechatapp.mengyao.poetry.core.PageResult;
import com.wechatapp.mengyao.poetry.vo.ChinesePoetryView;
import com.wechatapp.mengyao.poetry.vo.ChinesePoetryPageView;
import com.wechatapp.mengyao.poetry.entity.ChinesePoetry;
import com.wechatapp.mengyao.poetry.entity.PoetryType;

import java.util.List;
import java.util.Map;

/**
 * @author yanghuaxu
 * @date 2025/5/11 18:08
 */
public interface ChinesePoetryService {

    // 新增或更新诗词
    boolean saveOrUpdate(ChinesePoetry poetry);

    // 根据ID删除诗词
    boolean deleteById(Integer id);

    // 根据ID查询诗词
    ChinesePoetryView getById(Integer id);

    // 获取和currentId相同集合的随机一首诗
    ChinesePoetryView getRandomById(Integer currentId);

    PageResult<ChinesePoetryPageView> listByPage(Map<String,String> map);

    PageResult<ChinesePoetryPageView> listByPageFromEs(Map<String, String> params);

    List<PoetryType> getAllPoetryType();

    Map<Integer,String> getCollection(List<Integer> poetryIdList);

}
